import { defHttp } from '@/utils/http/axios'

enum Api {
  DATA_TREE = '/main/data/type/tree',
  DATA_LISTALL = '/main/data/type/listAll',
  ADD_DATA = '/main/data/type/add',
  UPDATE_DATA = '/main/data/type/update',
  DELETE_DATA = '/main/data/type/delete',
  DEVICE_DATA_PAGE = '/device/collector/measure/data/page',
  MEASURE_DATA_ADD = '/measure/data/add',
}

export const addDataType = (data) => defHttp.post({ url: Api.ADD_DATA, data })
export const addMeasureData = (data) => defHttp.post({ url: Api.MEASURE_DATA_ADD, data })
export const updateDataType = (data) => defHttp.post({ url: Api.UPDATE_DATA, data })
export const deleteDataType = (data) => defHttp.post({ url: Api.DELETE_DATA, data })
export const getDeviceDataPage = (params) => defHttp.get({ url: Api.DEVICE_DATA_PAGE, params })
export const getDataTypeTree = () => defHttp.get({ url: Api.DATA_TREE })
export const getDataTypeListAll = (params) => defHttp.get({ url: Api.DATA_LISTALL, params })
